package com.dongjiubigstone.networkmonitorapp.controller;

import com.dongjiubigstone.networkmonitor.po.Person;
import com.dongjiubigstone.networkmonitor.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import utils.LogUtil;


/**
 * 人控制器
 *
 * @author merlynr
 * @date 2020/11/17
 */
@RestController
public class HelloPersonController {

    @Autowired
    private PersonService personService;

    @GetMapping("/api/person/{id}")
    public Person getOne(@PathVariable("id") int id){
        return personService.getOneById(id);
    }

    /**
     * 你好
     *
     * @return {@link String}
     */
    @GetMapping("/api/hello")
    public String hello(){
        LogUtil.info(this.getClass(),"HHHHHHHH");
        return "Hello ";
    }
}
